package com.thread.sychronized;

/**
 * @author wangyingjie
 * @date
 * @remark 模拟取钱进程
 */
public class AccountDrawThread extends Thread {

    private Account account;

    private double money;

    public AccountDrawThread(Account account, double money) {
        this.account = account;
        this.money = money;
    }

    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            try {
                account.draw(money);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
